//
//  LLTabBarController.m
//  Happy to chat
//
//  Created by LL on 15/12/5.
//  Copyright © 2015年 LL. All rights reserved.
//   测试成功

#import "LLTabBarController.h"

@interface LLTabBarController ()

@end

@implementation LLTabBarController

- (void)viewDidLoad {
    [super viewDidLoad];
    
     // 1. 添加自控制器
    [self addChildControllers];
}

/**
 *  加载自控制器
 */
- (void)addChildControllers{
    
    // 1.1 记载自控制器
    NSArray *array = @[@"Entertainment",@"Messages",@"Friends",@"User"];
    
    // 1.2 得到SB
    
    //盛放子控制器
//    NSMutableArray *arrayM = [NSMutableArray array];
    
    for (NSString *sbName in array) {
        
        UIStoryboard *sb = [UIStoryboard storyboardWithName:sbName bundle:nil];
        
        UINavigationController *narVC = [sb instantiateInitialViewController];
        
//        [arrayM addObject:narVC];
        [self addChildViewController:narVC];
        
        narVC.tabBarItem.title = sbName;
    }
    
//    self.viewControllers = arrayM.copy;
    
    
}













@end
